﻿@addTagHelper "*, jundie.net.core_pager"
@model IEnumerable<jundie.net.core_pager.demo_cn.models.article>
@{
    ViewData["Title"] = "分页示例";
    ViewData["menu_demo"] = "active";
    var pagerOption = ViewData["pagerOption"] as jundie.net.core_pager.PagerOptions;
}
<h3>@ViewData["Message"]</h3>
<div class="panel panel-default">
    <!-- Default panel contents -->
    <div class="panel-heading">
        @ViewData["Title"] (@pagerOption.Total)
    </div>
    <!-- Table -->
    <table class="table table-striped table-bordered">
        <thead>
            <tr>
                <th>@Html.DisplayNameFor(model => model.Title)</th>
                <th>@Html.DisplayNameFor(model => model.Author)</th>
                <th>@Html.DisplayNameFor(model => model.Source)</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@item.Title</td>
                    <td>@item.Author</td>
                    <td>@item.Source</td>
                </tr>
            }
        </tbody>
    </table>
</div>

<div class="text-center">
    <V6-pager pager-option="pagerOption"
              id="pager"
              tag-name="div"
              tag-class-name="pagination"
              page-index-parameter-name="page"
              current-pager-item-template='<li class="page-item active"><a class="page-link" href="javascript:void(0);">{0}</a></li>'>
    </V6-pager>
</div>